/*
** token.c for 42sh in /home/guina_b/
** 
** Made by benoit guina
** Login   <guina_b@epitech.net>
** 
** Started on  Fri Jan 01 00:00:00 2010 benoit guina
** Last update Fri Jan 01 00:00:00 2010 benoit guina
*/

#include <string.h>
#include "alloc.h"
#include "token_type.h"
#include "token.h"

t_token *token_init(char *s, int pos)
{
  t_token *r;

  if ((r = xmalloc(sizeof(t_token), __FILE__, __LINE__)))
  {
    r->next = 0;
    r->type = token_type_identify(s, pos);
    r->s = s + pos;
  }
  return (r);
}

void token_free(t_token *token)
{
  xfree(token);
}
